//
//  UILabel+Extension.m
//  YLFinanceService
//
//  Created by she1323 on 2017/10/25.
//  Copyright © 2017年 she1323. All rights reserved.
//

#import "UILabel+Extension.h"

@implementation UILabel (Extension)


- (void)setLineSpacing:(CGFloat)spacing
{
    NSMutableAttributedString * attributedString = [[NSMutableAttributedString alloc] initWithString:self.text];
    NSMutableParagraphStyle * paragraphStyle = [[NSMutableParagraphStyle alloc] init];
    [paragraphStyle setLineSpacing:spacing];
    [attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [self.text length])];
    [self setAttributedText:attributedString];
    [self sizeToFit];
}
@end
